package com.neo.springframework;

import java.util.HashMap;
import java.util.Map;

/**
 * @author yezhiwei
 * @date 2021/6/17
 */
public class BeanFactory {

    private Map<String, BeanDefinition> beanDefinitionMap = new HashMap<>();

    public Object getBean(String name){
        BeanDefinition beanDefinition = beanDefinitionMap.get(name);
        return beanDefinition.getBean();
    }

    public void registerBeanDefinition(String name, BeanDefinition beanDefinition){
        beanDefinitionMap.put(name, beanDefinition);
    }
}
